# Fetching a list of Time Entries

Returns all time entries visible to the requesting user, unless filter parameters
have been applied.
This endpoint returns structured Time Entry objects.
As with all Kantata OX API endpoints, the returned data will be referenced in sorted order in the `results` array
and will be indexed by ID in the `time_entries` top-level JSON key.
Please see our [Response Format](#section/Response-Format) section for more information.

Endpoint: GET /time_entries
Version: 1.0.0

## Query parameters:

  - `approved` (boolean)
    Filter for time entries that are on approved timesheets or are in a project that does not require approvals. When included in your request, this filter is always processed as `true`; the actual value you provide is ignored.

  - `billable` (boolean)
    Return only billable (`true`) or only non-billable (`false`) time entries.

  - `created_after` (string)
    Filter for records created after a specified datetime. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `created_before` (string)
    Filter for records created before a specified datetime. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `created_by` (integer)
    Filter for time entries created by the specified user.

  - `date_performed_between` (string)
    Filter for time entries with work performed between 2 dates in a colon-separated YYYY-MM-DD format.
        For example, `2013-06-01:2013-08-01`.

  - `external_reference_external_message` (string)
    Filter the objects based on the external message of their associated external references. This is an exact match.

  - `external_reference_external_status` (string)
    Filter by the status of the external object in the external system.

  - `external_reference_service_model` (string)
    Filter by the type of the external object this external reference belongs to.

  - `external_reference_service_model_ref` (integer)
    Filter by the id of the external object this external reference belongs to.

  - `external_reference_service_model_refs` (string)
    Filter for objects that correlate to the specified external object IDs. Provide a comma-separated list of up to 200 external IDs.

  - `external_reference_service_name` (string)
    Filter by the name of the provider for integration.

  - `external_reference_status` (string)
    Filter by the status of the integration, this can be successful or fail.

  - `from_archived_workspaces` (boolean)
    If `true`, includes time entries from archived projects.

  - `has_external_references` (boolean)
    Filter by whether or not the object has external references.

  - `in_active_invoice_id` (integer)
    Limit results to time entries current in the specified active invoice.

  - `in_active_submission` (boolean)
    If true, filters for time entries that are part of active timesheet submissions (`active_submissions`).
             If false, filters for time entries that are not part of an active submission.

  - `include` (string)
    Any of the below associations can be included in your request by providing the `include` param, e.g. `include=association1,association2`.
- `active_submission` (TimesheetSubmission) - Retrieves the active timesheet (i.e. approved or pending) the time entry was submitted on, if any. The response will include `active_submission_id`, which references the data in the `timesheet_submissions` top-level key.
- `external_references` (ExternalReference) - Includes references to external integrations for this object.
- `invoice` (Invoice) - Retrieves the invoice the time entry was added to, if any. The response will include `invoice_id`, which references the data in the `invoices` top-level key.
- `recent_submission` (TimesheetSubmission) - Retrieves the most recent timesheet the time entry was submitted on, if any, including any rejected or cancelled timesheets. The response will include `recent_submission_id`, which references the data in the `timesheet_submissions` top-level key.
- `role` (Role) - Retrieves the project role of the user who performed the work for the time entry, if any. The response will include `role_id`, which references the data in the `roles` top-level key.
- `story` (Story) - Retrieves the task the time entry is tracked to, if any. The response will include `story_id`, which references the data in the `stories` top-level key.
- `user` (User) - Retrieves the user the time entry belongs to. The response will include `user_id`, which references the data in the `users` top-level key.
- `workspace` (Workspace) - Retrieves the project the time entry is tracked to. The response will include `workspace_id`, which references the data in the `workspaces` top-level key.

  - `invoiced` (boolean)
    Filter for time entries that have been invoiced. When included in your request, this filter is always processed as `true`; the actual value you provide is ignored. To get uninvoiced time entries instead, use the `uninvoiced` filter.

  - `on_my_account` (boolean)
    If `true`, only time entries that are in internal projects (i.e. projects that are on the same account as the authenticated user) are returned. If `false`, time entries that are in both internal and external projects are returned.

  - `only` (string)
    Allows you to request one or more resources directly by ID. Multiple IDs can be supplied
in a comma separated list, like `GET /api/v1/workspaces.json?only=5,6,7`.

  - `optional_fields` (array)
    Allows you to request one or more optional fields as an array.

  - `order` (string)
    Supply `order` with the name of a valid sort field for the endpoint and a direction.

Valid values: `created_at:asc`, `created_at:desc`, `date_performed:asc`, `date_performed:desc`, `updated_at:asc`, and `updated_at:desc`.

  - `page` (integer)

  - `per_page` (integer)

  - `uninvoiced` (boolean)
    Filter for time entries that have not been invoiced. When included in your request, this filter is always processed as `true`; the actual value you provide is ignored. To get invoiced time entries instead, use the `invoiced` filter.

  - `updated_after` (string)
    Filter for records updated after a specified datetime. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `updated_before` (string)
    Filter for records updated before a specified datetime. The datetime must be in [ISO 8601](https://www.w3.org/TR/NOTE-datetime) format.

  - `with_recent_timesheet_ids` (string)
    Filter for time entries from the specified [`TimesheetSubmission`](/tag/Timesheet-Submissions) IDs, including from canceled and rejected reports.
Give multiple report IDs in a comma separated list.

**Note**: Time entries are only associated with the most recent TimesheetSubmission (see `recent_submission`).
If you re-submit time from a canceled or rejected timesheet, a new `TimesheetSubmission` object is created,
and the time entries will only be returned in association with the new `TimesheetSubmission` from then on,
instead of with the canceled or rejected `TimesheetSubmission`.

Also note that there can only be 1 project per TimesheetSubmission. When a timesheet is submitted through the application frontend with
time entries for multiple projects, separate TimesheetSubmission objects are created for each project in the backend.

  - `with_timesheet_id` (integer)
    Filter for time entries from a specified [`TimesheetSubmission`](/tag/Timesheet-Submissions) ID.
      If the timesheet was canceled or rejected, no result is returned.

  - `with_user_ids` (string)
    Filter for time entries associated with the specified user IDs.
      Give multiple user IDs in a comma separated list. For example, '1,2,3'.

  - `without_external_reference_service_name` (string)
    Exclude by the existence of an external reference with the specified service name.

  - `workspace_id` (integer)
    Filter for time entries from the specified project.

  - `workspace_ids` (string)
    Filter for time entries associated with the specified project IDs.
             Give multiple project IDs in a comma separated list. For example, '1,2,3'.

## Response 200 fields (application/json):

  - `count` (integer)

  - `meta` (object)

  - `meta.count` (integer)

  - `meta.page_count` (integer)

  - `meta.page_number` (integer)

  - `meta.page_size` (integer)

  - `results` (array)

  - `results.key` (string)

  - `results.id` (string)

## Response 400 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 401 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 403 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 404 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 422 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

## Response 503 fields (application/json):

  - `errors` (array)

  - `errors.type` (string)

  - `errors.message` (string)

